package huanzhao.erp.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@TableName(value ="cost")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Cost implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 添加成本的时间
     */
    @TableField(value = "time")
    private Date time;

    /**
     * 手机id
     */
    @TableField(value = "phone_id")
    private Long phone_id;

    /**
     * 是否为维修成本
     */
    @TableField(value = "repair")
    private Boolean repair;

    /**
     * 金额
     */
    @TableField(value = "amount")
    private BigDecimal amount;

    /**
     * 费用描述
     */
    @TableField(value = "description")
    private String description;

    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public Cost(Long phoneId, boolean repair, BigDecimal amount, String description) {
        this.phone_id = phoneId;
        this.repair = repair;
        this.amount = amount;
        this.description = description;
    }
}